
	Ext.namespace("panel.widgets.chunks.panel.tools");

	panel.widgets.chunks.panel.tools.refresh = function(config) {
		
		var config = Ext.value(config, {});
		var tool = {};
		
		tool.handler = config.handler || function() {
			    	
	    	config.store.reload();
			
		};
		
		tool.tool = {
			id:     "refresh",
			qtip:   "Refresh data",
			handler: tool.handler
		};
		
		return tool;
		
	};
	
	panel.widgets.chunks.panel.tools.GridExpandCollapse = function(config) {
		
		var config = Ext.value(config, {});
		var tool = {};
		
		tool.handlerCollapse = config.handlerCollapse || function() {
			
			( config.grid instanceof Function ) ? 
				config.grid().collapseAllNodes() : 
				config.grid.collapseAllNodes();
			
		};
		
		tool.toolCollapse = {
			id:     "minus",
			qtip:   "Collapse all items",
			handler: tool.handlerCollapse
		};
		
		tool.handlerExpand = config.handlerExpand || function() {
			    	
	    	( config.grid instanceof Function ) ? 
				config.grid().expandAllNodes() : 
				config.grid.expandAllNodes();
			
		};
		
		tool.toolExpand = {
			id:     "plus",
			qtip:   "Expand all items",
			handler: tool.handlerExpand
		};
		
		return tool;
		
	};
